import sqlite3


def getConnection():
    conn = sqlite3.connect('db_music.db')
    return conn

conn = getConnection()
cursor = conn.cursor()
cursor.execute('DELETE FROM tb_music')
cursor.execute('DELETE FROM tb_singer')
cursor.execute('DELETE FROM tb_special')
cursor.execute('DELETE FROM tb_company')
cursor.execute('DELETE FROM tb_release')
cursor.execute("UPDATE sqlite_sequence SET seq=0 WHERE name='tb_music'")
cursor.execute("UPDATE sqlite_sequence SET seq=0 WHERE name='tb_singer'")
cursor.execute("UPDATE sqlite_sequence SET seq=0 WHERE name='tb_special'")
cursor.execute("UPDATE sqlite_sequence SET seq=0 WHERE name='tb_company'")
cursor.execute("UPDATE sqlite_sequence SET seq=0 WHERE name='tb_release'")
# cursor.execute('INSERT INTO tb_music(name) VALUES (?)', ("test",))
# print(cursor.lastrowid)
# cursor.execute('INSERT INTO tb_music(name) VALUES (?)', ("test",))
# print(cursor.lastrowid)
# cursor.execute('INSERT INTO tb_singer(name) VALUES (?)', ("TEST",))
# print(cursor.lastrowid)
# print(cursor.execute('SELECT * FROM tb_music').fetchall())
conn.commit()
conn.close()
